
<div class="container">

    <?php
    include 'member-left.php';
    include 'member-right.php';
    ?>

    <div class="member_c">


        <div class="title_mb_bg2">
            <?php if ($member->isOwner()) { ?>
                <div id="control_dis_stream">
                    <span>Chia sẻ: <input type="text" value="<?php echo DOMAIN;?>share.php?mid=<?php echo $_SESSION['client']['id'];?>&key=<?php echo md5($_SESSION['client']['create_date']);?>" style="width: 250px" onclick="$(this).select();"/></span>
                    <div class="right">
                        <?php if ($member->isOwner()) { ?><input type="button"  id="btnUpload" name="btnUpload" value="Tải ảnh lên" class="btnBlogComment left"><?php } ?>
                    </div>
                <?php } else { ?>
                    <div id="control_dis_stream">
                        
                        <div class="right">
                            <?php if ($member->isOwner()) { ?><input type="button"  id="btnUpload" name="btnUpload" value="Tải ảnh lên" class="btnBlogComment left"><?php } ?>
                        </div>
                    <?php } ?>

                    <div class="clear"></div>
                </div>
                <div class="album-list">
                    <ul>

                        <?php
                        $rsImage = $member->listMyAlbum();
                        while ($row = $db->fetch_array($rsImage['rs'])) {

                            echo '<li id="album_id_' . $row['id'] . '" >
                            <div class="photo-dis">
                                    <a class="photo-frame-01" href="thanh-vien?mid=' . $row['mid'] . '&aid=' . $row['id'] . '&action=anhcuatoi">
                                        <img src="' . $common->get_img_thumb($row['thumb']) . '"/>
                                    </a>';
                            if ($member->isOwner()) {
                                echo'<span onclick="Lightbox.showConfirm(\'Xác nhận xóa album\', \'Bạn có chắc muốn xóa album này không?\', \'removeAlbum(' . intval($row['id']) . ')\');" class="removealbum" title="Xóa album này"></span>';
                            }
                            echo'</div>
                             <div class="photo-desc">
                             <a class="viewImage" href="thanh-vien?mid=' . $row['mid'] . '&aid=' . $row['id'] . '&action=anhcuatoi">' . $row['name'] . '</a>
                                 <br><b>' . $row['count_num'] . ' ảnh</b>
                                   </div>
                              </li>';
                        }
                        ?>
                    </ul>
                </div>
            </div>
            <?php
            if ($rsImage['totalPage'] > 1) {
                ?>
                <div class="dangtin_un">
                    <span class="dt_un_r">
                        <?php
                        $page = $rsImage['page'];
                        if ($page < 1) {
                            $page = 1;
                        } else {
                            $pagePre = $page - 1;
                            $pageNext = $page + 1;
                            if ($rsImage['page'] <= 1) {
                                $htmlPre = 'Trang trước';
                            } else {
                                $htmlPreLink = '/thanh-vien?mid=' . $_GET['mid'] . '&action=xemalbum&page=' . $pagePre;
                                $htmlPre = '<a href="' . $htmlPreLink . '">Trang trước</a>';
                            }
                            if ($rsImage['page'] == $rsImage['totalPage']) {
                                $htmlNext = 'Trang sau';
                            } else {
                                $htmlNextLink = '/thanh-vien?mid=' . $_GET['mid'] . '&action=xemalbum&page=' . $pageNext;
                                $htmlNext = '<a href="' . $htmlNextLink . '">Trang sau</a>';
                            }
                        }
                        echo $htmlPre . ' | ' . $htmlNext;
                        ?>
                    </span>
                </div>
                <?php
            }
            ?>
        </div>
    </div>
    <script src="/js/album.js" type="text/javascript"></script>
